﻿namespace KLF.Lib.Browser.XMLHTTP
{
    #region Using Statements

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
using KLF.Lib.Browser.DOM.HTML;

    #endregion

    public class FormData : IFormData
    {
        #region Constructors

        public FormData()
        {
            _Data = new Dictionary<string, string>();
        }

        public FormData(HTMLFormElement form)
            : this()
        {
            foreach (var item in form.Elements)
            {
                if (item is HTMLInputElement)
                {
                    HTMLInputElement input = item as HTMLInputElement;

                    if (input.type == HTMLConstants.HTML_INPUT_SUBMIT)
                        continue;
                    else if (input.type == HTMLConstants.HTML_INPUT_RESET)
                        continue;
                    else if ((input.type == HTMLConstants.HTML_INPUT_RADIO ||
                        input.type == HTMLConstants.HTML_INPUT_CHECKBOX) && !input.@checked)
                        continue;
                }
            }
        }

        #endregion

        #region Attributes

        public Dictionary<string, string> _Data { get; set; }

        #endregion

        #region IFormData Members

        public void append(string name, IBlob value, string filename)
        {
            throw new NotImplementedException();
        }

        public void append(string name, IBlob value)
        {
            throw new NotImplementedException();
        }

        public void append(string name, string value)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
